package co.fitstart.entity.principal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

/**
 * 客服二维码
 * 
 * @author jiecheng
 *
 */
@Entity
@Table(name = "service_qrcode")
@DynamicUpdate
@JsonIgnoreProperties(value={"hibernate_lazy_initializer","handler","fieldHandler"})
public class ServiceQrcode {

    @Id
    @GeneratedValue
    private Long id;
    
    /** 
     * 别名 （online-0，offline-0， offline-1） 
     * 
     * 根据类别以及门店生成
     * 
     **/
    private String alias;
    
    private String name;
    
    /** 二维码的文件路径名   */
    private String value;
    
    /** 二维码类型 */
    @Enumerated(EnumType.ORDINAL)
    private QrcodeType type;
    
    @Column(name = "is_disabled")
    private boolean disabled;
    
    /**
     * default constructor
     */
    public ServiceQrcode() {
        
    }
    
    /**
     * 
     * @param siteId
     * @param name
     * @return
     */
    public ServiceQrcode initialize(String siteId , String name){
        this.alias = siteId;
        this.name = name;
        return this;
    }
    
    /**
     * 
     * @param value
     * @return
     */
    public ServiceQrcode editValue(String value) {
        this.value = value;
        return this;
    }

    /**
     * @return the id
     */
    public Long getId() {
        return id;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @return the value
     */
    public String getValue() {
        return value;
    }
    
    /**
     * @return
     */
    public QrcodeType getType() {
        return type;
    }

    /**
     * @return the disabled
     */
    public boolean isDisabled() {
        return disabled;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param alias the alias to set
     */
    public void setAlias(String alias) {
        this.alias = alias;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @param value the value to set
     */
    public void setValue(String value) {
        this.value = value;
    }

    /**
     * @param type
     */
    public void setType(QrcodeType type) {
        this.type = type;
    }
    
    /**
     * @param disabled the disabled to set
     */
    public void setDisabled(boolean disabled) {
        this.disabled = disabled;
    }
}
